-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add initial implementation of resampy library #15341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Semyon Moroz <[email protected]>
Co-authored-by: Semyon Moroz <[email protected]>
Co-authored-by: Semyon Moroz <[email protected]>
Co-authored-by: Semyon Moroz <[email protected]>
Co-authored-by: Semyon Moroz <[email protected]>
Co-authored-by: Semyon Moroz <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I’ve found a few more points; sorry for such a fragmentary review.
No, thank YOU! About the "fragmentary review": I certainly understand that if you were reviewing the work of a peer, they would likely prefer everything at once. But I'm not your peer, and my PR needs a lot more reviewing than a PR from an experienced programmer. And to be frank, I'm very happy you did not put all of this in the first review. I think that would have been disheartening for me. These "fragments" are just the right size for me: I'm learning, but not overwhelmed. Thank you very much for your patience with my inexperience and for essentially mentoring me through this process. I'll study the comments you left and make changes. |
Co-authored-by: Semyon Moroz <[email protected]>
Co-authored-by: Semyon Moroz <[email protected]>
Co-authored-by: Semyon Moroz <[email protected]>
Co-authored-by: Semyon Moroz <[email protected]>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Semyon Moroz <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
unrecognized setting "$schema".Running: /opt/hostedtoolcache/Python/3.13.11/x64/bin/pyright --pythonplatform Windows --pythonversion 3.9
Config contains unrecognized setting "$schema".https://github.com/python/typeshed/actions/runs/21557033413/job/62115164783?pr=15341#step:11:24 On my computer, I get the same output. >py -m tests.runtests stubs/resampy --run-stubtest
...
Running: C:\Program Files\nodejs\npx.CMD [email protected] stubs\resampy --pythonversion 3.9 -p pyrightconfig.stricter.json
0 errors, 0 warnings, 0 informations
Config contains unrecognized setting "$schema".All tests.runtests Details
(.venv) C:\clones\typeshed>py -m tests.runtests stubs/resampy --run-stubtest
Running pre-commit...
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check toml...............................................................Passed
check for merge conflicts................................................Passed
mixed line ending........................................................Passed
check for case conflicts.................................................Passed
Run ruff on stubs, tests and scripts.....................................Passed
Run ruff on the test cases...........................(no files to check)Skipped
black....................................................................Passed
flake8...................................................................Passed
Check hooks apply to the repository..................(no files to check)Skipped
Running check_typeshed_structure.py...
Running Pyright (stricter configs) for Python 3.9...
11.4.2
Running: C:\Program Files\nodejs\npx.CMD [email protected] stubs\resampy --pythonversion 3.9 -p pyrightconfig.stricter.json
0 errors, 0 warnings, 0 informations
Config contains unrecognized setting "$schema".
Running mypy for Python 3.9...
*** Testing Python 3.9 on win32
Testing third-party packages...
testing resampy (5 files)... success
--- success, 5 files checked ---
Running stubtest...
resampy... (65.07 s) success
Note: resampy is not currently tested on win32 in typeshed's CI
Regression tests: No test_cases folder for 'resampy'!
--- TEST SUMMARY: All tests passed! ---
pre-commit Success
Check structure: Success
Pyright: Success
mypy: Success
stubtest: Success
Pyright regression tests: Success
mypy regression test: SuccessIs that important? np.floatingThe failures on Python 3.9 are of the following type: But maybe that is because of the kwargs and ndarrayI wrote this stub 11 months ago, and I guess I have learned a lot more than I realized since then. I fixed kwargs: Any. We actually know exactly what the keywords and their types are. I mimicked Unpack from ast.pyi, but I'm certainly not claiming that is the "best" or the "right" way to annotate this. I also realized that I was letting the type checker boss me around. The np.ndarray used as filters in this package are very specific: 1-axis, float64. Always. I was annotating based on what Pylance was telling me instead of using my brain to read the freaking code. Therefore, I tightened up those annotations. "internal" functions
I think I tried removing them and the allowlist, but the tests on my computer were unhappy. error: resampy.interpn.resample_f_p is not present in stub
Stub: in file C:\clones\typeshed\stubs\resampy\resampy\interpn.pyi
MISSING
Runtime: at line 73
def (x, t_out, interp_win, interp_delta, num_table, scale, y)
error: resampy.interpn.resample_f_s is not present in stub
Stub: in file C:\clones\typeshed\stubs\resampy\resampy\interpn.pyi
MISSING
Runtime: at line 81
def (x, t_out, interp_win, interp_delta, num_table, scale, y)I restored the stubtest_allowlist, and wrote a comment. |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Introduce core functionality and metadata for the resampy library, including initial stubs for resampling methods and filter functions. Update metadata to specify dependencies.
See also #15338.